<!--
  按钮列表
-->

<template>
  <el-button v-for="item in btnList" :icon="item.icon" @click="btnClick(item.id)">
    {{item.label}}
  </el-button>
</template>

<script>
export default {
  name: "buttonList",
  props: {
    btnList: {typeof :Object},
    DialogVisible: {type: Boolean},
  },
  emits: ['add','plDelete','import','export'],
  data() {
    return {
      DialogVisible: this.DialogVisible
    }
  },
  methods: {
    btnClick(id) {
      if (id == 'add') {
        console.log('添加');
        this.DialogVisible = true;
        this.$emit('add');
      }else if (id == 'plDelete'){
        console.log('批量删除');
        this.$emit('plDelete');
      }else  if (id == 'import'){
        console.log('导入');
        this.$emit('import');
      }else if (id == 'export'){
        console.log('导出');
        this.$emit('export');
      }
    }
  }
}
</script>

<style scoped>

</style>